package DataStructureAndAlgorithm.AcWing_每日一题.双指针;

import java.util.Scanner;
//链接：https://www.acwing.com/problem/content/3804/
public class AcWing_3801 {
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int N = 100010;
        int[] nums = new int[N];
        int t = in.nextInt();

        for (int k = 0; k < t; k++){
            int n = in.nextInt();
            int max = 0;
            int res = 1;
            //最优解的连续子数组的算术平均值即为整个数组的max
            for (int i = 0; i < n; i++){
                nums[i] = in.nextInt();
                max = Math.max(max,nums[i]);
            }
            //用双指针，求出所有连续max数的长度即为答案
            for (int i = 0; i < n; i++){
                if (nums[i] == max){
                    int j = i + 1;
                    while (j < n && nums[j] == max)j++;
                    res = Math.max(res,j - i);
                    i = j - 1;
                }
            }
            System.out.println(res);
        }
        in.close();
    }
}
